<%--
  Created by IntelliJ IDEA.
  User: liujie
  Date: 2016/9/1
  Time: 16:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title></title>
</head>
<body>
<div class="pageHeader">
    <form rel="pageForm" onsubmit="return navTabSearch(this);"
          action="<c:url value='/survey/question/index'/>" method="post">
        <div class="searchBar">
            <ul>
                <li style="float: left; line-height: 25px;">
                    <label>所属问卷：</label>
                    <select name ="area" >
                        <option value=""></option>
                        <c:forEach var="survey" items="${surveyList}" varStatus="vs">
                            <option value="${survey.id}" ${query.area eq survey.id ? "selected":""}>
                            ${survey.name}
                            </option>
                        </c:forEach>
                    </select>
                </li>
                <li style="float: left; line-height: 25px;">
                    <label>题目名称：</label> <input name="keywords"
                                              type="text" value="${query.keywords}"
                                              placeholder="请输入题目名称检索"
                                              style="width: 230px; font-family: '微软雅黑 sans-serif serif';"/>
                </li>
                <li>
                    <div class="buttonActive" style="margin-left: 5px;">
                        <div class="buttonContent">
                            <button type="submit">查找</button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>
<div class="pageContent" style="padding-top: 1px;">
    <div class="panelBar">
        <ul class="toolBar" style="float: left;display: inline-block;">
            <li><a class="add" href="<c:url value='/survey/question/view/-1'/>" target="dialog" width="500" height="400" mask="true"
                   resizable="false" maxable="false"><span>添加题目</span></a></li>
            <li class="line"></li>
            <li><a class="delete" href="<c:url value='/survey/question/delete/{sel_id}'/>" target="ajaxDel" title="是否确认删除当前题目？"><span>删除</span></a></li>
            <li class="line"></li>
            <li><a class="edit" href="<c:url value='/survey/question/view/{sel_id}'/>" target="dialog" width="500" height="400" mask="true" resizable="false"
                   maxable="false" title="编辑题目" ><span>编辑</span></a></li>
        </ul>
    </div>
    <table class="table" width="100%" layoutH="110">
        <thead>
        <tr>
            <th width="20" align="center">序号</th>
            <th width="100">所属问卷</th>
            <th width="250">题目名称</th>
            <th width="80">题目类型</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach var="question" items="${pager.list}" varStatus="vs">
            <tr target="sel_id" rel="${question.id}">
                <td>${vs.count+(pager.pageNum-1)*pager.numPerPage}</td>
                <c:forEach var="survey" items="${surveyList}" varStatus="vs">
                    <c:if test="${question.belong eq survey.id}"><td>${survey.name}</td></c:if>
                </c:forEach>
                <td>${question.title}</td>
                <c:if test="${question.type eq '1'}"><td>单选题</td></c:if>
                <c:if test="${question.type eq '2'}"><td>多选题</td></c:if>
                <c:if test="${question.type eq '3'}"><td>判断题</td></c:if>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <div class="panelBar">
        <div class="pages">
            <span>显示&nbsp;</span> <select id="cob_ps" class="combox"
                                          name="numPerPage"
                                          onchange="navTabPageBreak({numPerPage:this.value})">
            <option value="20" <c:if test="${pager.numPerPage == 20}"> selected="selected"</c:if>>20</option>
            <option value="50" <c:if test="${pager.numPerPage == 50}"> selected="selected"</c:if>>50</option>
            <option value="100" <c:if test="${pager.numPerPage == 100}"> selected="selected"</c:if>>100</option>
            <option value="200" <c:if test="${pager.numPerPage == 200}"> selected="selected"</c:if>>200</option>
        </select> <span>条，共${pager.total}条</span>
        </div>
        <div class="pagination" targetType="navTab"
             totalCount="${pager.total}" numPerPage="${pager.numPerPage}"
             pageNumShown="10" currentPage="${pager.pageNum}"></div>
    </div>
    <form id="pagerForm" method="post"
          action="<c:url value='/survey/question/index'/>">
        <input type="hidden" name="pageNum" value="${pager.pageNum}"/>
        <input type="hidden" name="handler" value="${query.handler}"/>
        <input type="hidden" name="numPerPage" value="${pager.numPerPage}"/>
        <input type="hidden" name="orderField" value="${query.orderField}"/>
        <input type="hidden" name="orderDirection" value="${query.orderDirection}"/>
        <input type="hidden" name="keywords" value="${query.keywords}"/>
        <input type="hidden" name="area" value="${query.area}"/>
    </form>
</div>

</body>
</html>
